package cn.dinxian.api;
import cn.dinxian.entity.ActWorkflowFormData;
import cn.dinxian.entity.Base2DTO;
import cn.dinxian.entity.BaseDTO;
import cn.dinxian.entity.CommonResult;
import cn.dinxian.entity.MyProcessDefinition;
import feign.Response;
import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author dingxian
 * @Title:
 * @param:
 * @return:
 * @Date 2023/2/21 21:31
 * @Description:
 */

@FeignClient(value = "activiti-provider")
public interface RepositoryService {

  /**
   *  获取流程的配置信息
   * @param dto
   * @return
   */
  @PostMapping( "/Repository-provider/ProcessDefinition")
  public CommonResult<MyProcessDefinition> ProcessDefinition(MyProcessDefinition dto);

  /**
   * 
   * 获取流程的部署文件
   * @param dto
   * @return
   */
  @PostMapping( "/Repository-provider/getResourceAsStream")
  public Response getResourceAsStream( BaseDTO dto);

  /**
   * 
   * 查询流程
   * @param dto
   * @return
   */
  @PostMapping( "/Repository-provider/selectProcessDefinitionList")
  public List<MyProcessDefinition> selectProcessDefinitionList(MyProcessDefinition dto);

  /**
   * 删除流程
   * @param dto
   * @return
   */
  @PostMapping( "/Repository-provider/deleteProcessDefinition")
  public CommonResult<MyProcessDefinition> deleteProcessDefinition(MyProcessDefinition dto) ;

  /**
   * 部署流程
   * @param file
   * @return
   */
  //@PostMapping(value = "/Repository-provider/uploadStreamAndDeployment" , headers = {"Content-Type=multipart/form-data;charset=UTF-8"})
  @RequestMapping(value = "/Repository-provider/uploadStreamAndDeployment" , method= RequestMethod.POST,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
  public CommonResult<MyProcessDefinition> uploadStreamAndDeployment(@RequestPart("file") MultipartFile file);

  /**
   * 
   * @param file
   * @return
   */
  @PostMapping( "/Repository-provider/suspendOrActiveApply")
  public CommonResult<MyProcessDefinition> suspendOrActiveApply(MyProcessDefinition file);

  /**
   * 
   * @param file
   * @return
   */
  @PostMapping( "/Repository-provider/addDeploymentByString")
  public CommonResult<MyProcessDefinition> addDeploymentByString(MyProcessDefinition file);

  /**
   * 数据保存
   * @param dto
   * @return
   */
  @PostMapping( value ="/Repository-provider/formDataSave" )
  public List<ActWorkflowFormData>  formDataSave(Base2DTO dto);








}
